<{include file="common/header.tpl"}>
<{include file="SDK/style.tpl"}>
<section id="spread_one" class="column">
        <form method="" action="">
        <article class="module width_3_quarter">
        <header>
            <h3 style="width:96%; position: relative;" class="tabs_involved ">
            SDK接入开发者列表
            <span class="special">现有开发者</span>

            <{if $user_info.passport == 'tanghaiquan@哇吖.com' || $user_info.passport == 'zhanghuiping@哇吖.com' }>
            <span style="position: absolute; right: 1em;"><a class="tomato" href="/CPC/add_auto_channel">+添加开发者</a></span>
            <{/if}>
            </h3>
        </header>
		<div class="tab_container">
			<div id="tab1" class="tab_content">
			<table class="tablesorter" cellspacing="0"> 
			<thead> 
				<tr style="text-align: center;">  
    				<th width="20%">创建日期</th> 
    				<th width="30%">开发者名称</th> 
    				<th width="50%">应用接入</th> 
				</tr> 
			</thead> 
			<tbody>
				<{foreach from = $developers item = 'v'}> 
					<tr title="<{"Y-m-d H:i:s"|@date:$v.mtime}>">
						<td align="center"><{"Y-m-d H:i"|@date:$v.ctime}></td>
						<td align="center"><a class="tomato" href="/channel/detail/<{$v.id}>"><{$v.name}></a></td>
                        <td>
                            <{if $v.apps|@count > 0}>
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                            <{foreach from=$v.apps item="app"}>
                            <tr bgcolor="#EEEEE">
                                <td width="30%"><{$app.pkgname}></td>
                                <td width="40%"><{$app.appname}></td>
                                <td width="30%"><{"Y-m-d"|@date:$app.ctime}></td>
                            </tr>
                            <{/foreach}>
                            </table>
                            <{else}>
                            &nbsp;
                            <{/if}>
                        </td>
					</tr> 
				<{/foreach}>
			</tbody> 
			</table>

                <{include file="SDK/developers/summary.tpl"}>
			</div><!-- end of #tab1 -->
		</div><!-- end of .tab_container -->
		</article><!-- end of content manager article -->
		<div class="clear"></div>
	</section>
	
	<script>

		function edit(id){
			var input = 'input_' + id;
			var edit = 'edit_' + id;
			var value_id = 'value_' + id;
			document.getElementById(edit).style.display="none"; 
			document.getElementById(input).style.display="block"; 
			document.getElementById(value_id).focus();
			var tmp_value = document.getElementById(value_id).value
			document.getElementById(value_id).onblur = function(){
				var value = document.getElementById(value_id).value
				if(value == '')
				{
					window.location.reload();	
					return;
				}
				if (tmp_value == value)
				{
				 	window.location.reload();
					return;
				}
				var url = 'http://admin.union.哇吖.com/CPC/ratio/' +id+ '/' + value;
				$.get(url, {} ,function (data) {
					if(data.status == '0'){
						alert('修改成功！');
						window.location.reload(); 
					}else{
						alert('修改失败！');
						window.location.reload(); 
					}
           		 } , 'json');
			};
			
		}
	</script>			
<{include file="common/footer.tpl"}>
